Skip to content

Conversation

@hcheng2002cn
Copy link

unit test with the script:

from pglast import parse_sql
import time
import threading

#cmd = 'SELECT * FROM (SELECT DISTINCT ON (Item) "Item", "Location" FROM "adam/UN"."t10" ORDER BY "Item", "Location" DESC) ORDER BY "Location" DESC;'
cmd = 'SELECT * FROM (SELECT DISTINCT ON (Item) "Item", "Location" FROM "adam/UN"."t10" ORDER BY "Item", "Location" DESC) a ORDER BY "Location" DESC;'

def parser():
	try:
		try:
			parse_sql(cmd)
            print("all good.")
		except Exception as e:
			print(e)
			raise
	except:
		time.sleep(1)
		pass

for i in range(100):
	x = threading.Thread(target=parser)
	time.sleep(1)
	x.start()

while 1:
	pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant